<?php
use yii\helpers\Html;
use yii\helpers\Url;
?>
<style>
#self .weui_panel:after {
  border-bottom: 0px;
}
#self .weui_cells:after {
  border-bottom: 0px;
}
#self .weui_grid:before {
  border-bottom: 0px;
}
#self .weui_grids:before {
    border: 0px;
}
#self .weui_grid::before {
  border-right: 0px;
}
#self .weui_grid{
  width: 33.333333%;
  padding: 12px;
}
#self .weui_cell_bd{
  color:#666666;
  font-size:15px;
  padding-left: 17px;
}
#self .weui_cell{
  padding-left: 10vw;
  padding-right: 10vw;
}
#self .weui_grid .weui_grid_label{
  color:#666666;
  font-size:15px;
}
#self .setting{
  margin-top: -20.8vw;
  position: relative;
  height: 22px;
  width: 22px;
  left:calc(100vw - 50px);
  left:-moz-calc(100vw - 50px);
  left:-webkit-calc(100vw - 50px);
}
</style>

<div class="pepole_top2 pepole_<?php echo $model->isWoman() ? 'woman' : 'man'; ?>2">
	<div class="avatar_bg">
		<img src="resources/images/market/woman/u185.png">
	</div>
	<div class="avatar">
		<img src="<?= $model->headimgurl ?>">
	</div>
	
	<div class="baseInfo_div">
		<div class="name">
			<p><?php echo $model->theName; ?></p>
		</div>
		<div class="mark">
			<p><span><?php echo \common\wosotech\Util::getShortString($model->company, 12, ''); ?></span></p>
		</div>
	</div>
	
	<div onclick="gotoSetting()" class="setting">
		<img style="max-height: 22px; max-width: 22px;" src="resources/images/self/u1659.png">
	</div>
	
</div>

<div style="background: #ffffff none repeat scroll 0 0;" class="weui_grids">
    <div onclick="gotoSystem()" class="weui_grid" style="padding-left: 10vw;">
        <?php if ($model->getUnreadSystemRecvChatCount(Yii::$app->keyStorage->get('business.system_sender_id', 2))): ?>
		<div class="count" style="left:calc(10vw + 60px);left:-moz-calc(10vw + 60px);left:-webkit-calc(10vw + 60px);">...</div>
        <?php endif; ?>
        <p class="weui_grid_label" style="text-align: left;">系统信息</p>
    </div>
    <div onclick="gotoFriend()" class="weui_grid">
<?php 
/*
        <?php if (!empty($model->friendCount)): ?>
		<div class="count"><?php echo $model->friendCount; ?></div>
        <?php endif; ?>
*/ 
?>
        <?php if ( ($n = $model->getUnreadRecvChatCount() + $model->getWaitingAddFriendChatCount()) > 0 ): ?>
        <!--
		<div class="count"><?php echo $n; ?></div>
        -->
		<div class="count" style="left:calc(10vw + 60px);left:-moz-calc(10vw + 60px);left:-webkit-calc(10vw + 60px);">...</div>
        <?php endif; ?>

        <div class="weui_grid_label">我的好友</div>
    </div>
    <div onclick="gotoPost()" class="weui_grid" style="padding-right: 10vw;">
<?php
/*
        <?php if (!empty($model->postCount)): ?>
		<div class="count" style="left:auto;right:calc(10vw - 17px);right:-moz-calc(10vw - 17px);right:-webkit-calc(10vw - 17px);">
        <?php echo $model->postCount; ?></div>
        <?php endif; ?>
*/
?>
        <?php if ($n = $model->getReceivedPostResponseCount()): ?>
		<div class="count" style="left:auto;right:calc(10vw - 17px);right:-moz-calc(10vw - 17px);right:-webkit-calc(10vw - 17px);">
        <?php echo $n; ?></div>
        <?php endif; ?>

        <p class="weui_grid_label" style="text-align: right;">我的帖子</p>
    </div>
</div>

<div style="width:100%;height:8px;"></div>
<div class="weui_panel">
    <div class="weui_panel_bd">
        <div class="weui_media_box weui_media_small_appmsg">
            <div class="weui_cells weui_cells_access">
                <a href="<?php echo Url::to(['wap/post-add']); ?>" class="weui_cell">
                    <div class="weui_cell_hd">
						<img style="width:20px;margin-right:5px;display:block" alt="" src="resources/images/self/u1676.png"></div>
                    <div class="weui_cell_bd weui_cell_primary weui_cell_text">
                        <span>我要发帖</span>
                    </div>
                    <span class="weui_cell_ft"></span>
                </a>
                <a href="<?php echo Url::to(['wap/self-resources-home']);//echo Url::to(['wap/market-list', 'id'=>$model->id]); ?>" class="weui_cell">
                    <div class="weui_cell_hd">
						<img style="width:20px;margin-right:5px;display:block" alt="" src="resources/images/self/u1678.png"></div>
                    <div class="weui_cell_bd weui_cell_primary weui_cell_text">
                        <span>我的资源</span>
                    </div>
                    <span class="weui_cell_ft"></span>
                </a>
            </div>
        </div>
    </div>
</div>

<div style="width:100%;height:8px;"></div>
<div class="weui_panel">
    <div class="weui_panel_bd">
        <div class="weui_media_box weui_media_small_appmsg">
            <div class="weui_cells weui_cells_access">
                <a href="<?php echo Url::to(['wap/self-personal-view']); ?>" class="weui_cell">
                    <div class="weui_cell_hd">
						<img style="width:20px;margin-right:5px;display:block" alt="" src="resources/images/self/u1661.png"></div>
                    <div class="weui_cell_bd weui_cell_primary weui_cell_text">
                        <span>个人中心</span>
                    </div>
                    <span class="weui_cell_ft"></span>
                </a>
                <a href="<?php echo Url::to(['wap/self-mygold']); ?>" class="weui_cell">
                    <div class="weui_cell_hd">
						<img style="width:20px;margin-right:5px;display:block" alt="" src="resources/images/self/u1657.png"></div>
                    <div class="weui_cell_bd weui_cell_primary weui_cell_text">
                        <span>积分</span>
                    </div>
                    <span class="weui_cell_ft"></span>
                </a>
            </div>
        </div>
    </div>
</div>

<div style="width:100%;height:8px;"></div>
<div class="weui_panel">
    <div class="weui_panel_bd">
        <div class="weui_media_box weui_media_small_appmsg">
            <div class="weui_cells weui_cells_access">
                <a onclick="gotoSetting()" class="weui_cell">
                    <div class="weui_cell_hd">
						<img style="width:20px;margin-right:5px;display:block" alt="" src="resources/images/self/u1689.png"></div>
                    <div class="weui_cell_bd weui_cell_primary weui_cell_text">
                        <span>设置</span>
                    </div>
                    <span class="weui_cell_ft"></span>
                </a>
            </div>
        </div>
    </div>
</div>

<div style="width:100%;height:70px;"></div>

<script type="text/javascript">

function gotoSetting()
{
	//window.location.href="setting/home.jsp";
  	window.location.href="<?php echo Url::to(['wap/setting-home']); ?>";
}
function gotoFriend()
{
	//window.location.href="self_friend.jsp";
  	window.location.href="<?php echo Url::to(['wap/self-friend-myfriend']); ?>";
}
function gotoPost()
{
	//window.location.href="self_post.jsp";
  	window.location.href="<?php echo Url::to(['wap/self-post-mypost']); ?>";
}
function gotoSystem()
{
	//window.location.href="system.jsp";
  	//window.location.href="<?php echo Url::to(['wap/system']); ?>";
    window.location.href="<?php echo Url::to(['wap/chat', 'id' => Yii::$app->keyStorage->get('business.system_sender_id', 2)]); ?>";
}
</script>

<?php
/*
$(function () {
    var jumpUrl = "<?php echo $this->context->getMe()->getJump() ?>";
    if (jumpUrl.length)
    {
        window.location.href = jumpUrl;        
        return false;
    }
})

*/